/// // To parse this JSON data, do
//
//     final serverData = serverDataFromMap(jsonString);

import 'dart:convert';

ServerData serverDataFromMap(String str) => ServerData.fromMap(json.decode(str));

String serverDataToMap(ServerData data) => json.encode(data.toMap());

/// 服务器地址模型
class ServerData {
  /// 升级说明
  final int? appType;

  /// 环境类型  1=正式服，2=预发布 ，3=测试服
  final String? code;

  /// 升级说明
  final String? content;

  /// 环境类型  1=正式服，2=预发布 ，3=测试服
  final int? envType;

  ///
  final String? packSize;

  /// 安装包下载地址(内部下载地址)
  final String? packUrl;

  /// 端口号
  final String? servicePort;

  /// 接口访问地址
  final String? serviceUrl;

  /// 中转平台接口路径
  final String? transferUrl;

  /// 静态资源访问路径，如H5页面 vue资源
  final String? serviceVueUrl;

  /// 更新方式,1=强制更新，2=可选更新
  final int? updateType;

  /// 第三方下载页面url
  final String? url;

  /// 客户查看的版本号
  final String? versionNo;

  ServerData({
    this.appType,
    this.code,
    this.content,
    this.envType,
    this.packSize,
    this.packUrl,
    this.servicePort,
    this.serviceUrl,
    this.transferUrl,
    this.serviceVueUrl,
    this.updateType,
    this.url,
    this.versionNo,
  });

  factory ServerData.fromMap(Map<String, dynamic> json) => ServerData(
        appType: json["appType"],
        code: json["code"],
        content: json["content"],
        envType: json["envType"],
        packSize: json["packSize"],
        packUrl: json["packUrl"],
        servicePort: json["servicePort"],
        serviceUrl: json["serviceUrl"],
        transferUrl: json['transferUrl'],
        serviceVueUrl: json["serviceVueUrl"],
        updateType: json["updateType"],
        url: json["url"],
        versionNo: json["versionNo"],
      );

  Map<String, dynamic> toMap() => {
        "appType": appType,
        "code": code,
        "content": content,
        "envType": envType,
        "packSize": packSize,
        "packUrl": packUrl,
        "servicePort": servicePort,
        "serviceUrl": serviceUrl,
        "transferUrl": transferUrl,
        "serviceVueUrl": serviceVueUrl,
        "updateType": updateType,
        "url": url,
        "versionNo": versionNo,
      };
}
